package com.freewater.springboot.demo.resource.resourcepattern;

import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        PathMatchingResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
        // 打印当前项目classpath下的所有properties文件，不包含jar包中的，如果需要打印jar包中的，则pattern为：classpath*:**/*.properties
        for (Resource resource : resourcePatternResolver.getResources("classpath:**/*.properties")) {
            System.out.println(resource.getDescription());
        }
    }
}
